<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>

<script type="text/javascript">
	//随机数[0,1）
	console.log(Math.random())

	//圆周率
	console.log(Math.PI)

	console.log('四舍五入',Math.round(10.6)) //11

	console.log('向上取整',Math.ceil(10.1)) //11

	console.log('向下取整',Math.floor(10.9)) //10

	console.log('平分',Math.pow(10,3)) //1000

	console.log('开根号',Math.sqrt(2))

	console.log('最大值',Math.max(1,28,40,20,30,10))
	
	console.log('最小值',Math.min(1,28,40,20,30,10))

	// 取小数toFixed(保留几位小数)
	let a = 9.13321151354
	console.log(a.toFixed(2)) //9.13


	// 3 4
	let c = 3
	let b = 4
	let d = Math.sqrt(Math.pow(c,2)+Math.pow(b,2))
	console.log(d)




</script>
</body>
</html>